import * as confObj from '../../config/manifest.json'
export default {
    loader_js (entrance: string ) {
        if (entrance) {
            entrance += '.js'
        } else {
            return ''
        }
        let result = '';
        if (confObj && confObj.deps && confObj.deps[entrance] && confObj.deps[entrance]['js']) {
            confObj.deps[entrance]['js'].forEach((element: string) => {
                result += '<script src="'+ element +'"></script>'
            });
        }
        return result
    },
    loader_css (entrance: string ) {
        if (entrance) {
            entrance += '.js'
        } else {
            return ''
        }
        let result = '';
        if (confObj && confObj.deps && confObj.deps[entrance] && confObj.deps[entrance]['css']) {
            confObj.deps[entrance]['css'].forEach((element: string) => {
                result += '<link ref="stylesheet" href="'+ element +'">'
            });
        }
        return result
    }
}
  